package com.sky.service.user.impl;

import com.sky.constant.StatusConstant;
import com.sky.mapper.user.UserSetMealMapper;
import com.sky.pojo.Setmeal;
import com.sky.service.user.UserSetMealService;
import com.sky.vo.DishItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserSetMealServiceImpl implements UserSetMealService {
    @Autowired
    private UserSetMealMapper userSetMealMapper;
    @Override
    public List<Setmeal> findByCategoryId(Long categoryId) {
        Setmeal setmeal = Setmeal.builder()
                .categoryId(categoryId)
                .status(StatusConstant.ENABLE)
                .build();
        return userSetMealMapper.findByCategoryId(setmeal);
    }

    @Override
    public List<DishItemVO> findBySetMealId(Long setmealId) {
        return userSetMealMapper.findBySetMealId(setmealId);
    }
}
